<?php echo $this->Html->css('form'); ?>
<?php echo $this->Html->css('search'); ?>

<div class="contentMain">
	<div class="grayBox">
		<div class="form_wrapper">
			<div class="title">Change Password</div>
			<ul class="editBox">
				<?
					echo $this->Form->create('User', array('action' => 'edit_password'));
				?>
				<li>
					<label class="titleName" style="width: 153px">Old Password</label>
					<?=$this->Form->input('old_password', array(
						'type'=>'password', 'label'=>false, 'div'=>false, 'value'=>'', 'style'=>'margin-right:5px;width:200px',
						'required' => 'required',
						'placeholder' => 'Your old password'));?>
				</li>
				
				<li>
					<label class="titleName" style="width: 153px">New Password</label>
					<?
						echo $this->Form->input('password', array(
							'type'=>'password', 'label'=>false, 'div'=>false, 'value'=>'', 'style'=>'margin-right:5px;width:200px',
							'required' => 'required',
							'placeholder' => 'Your new password',
							'pattern' => '.{6,20}',
							'title' => 'Password length must be in range 6 - 20'));
						if(isset($session->validationErrors) && isset($session->validationErrors['User']['password_confirm']))
						{
							echo('<div class="error-message">'.$session->validationErrors['User']['password_confirm'].'</div>');
						}
					?>
				</li>
				
				<li>
					<label class="titleName" style="width: 153px">Confirm New Password</label>
					<?=$this->Form->input('password_confirm', array(
						'type'=>'password', 'label'=>false, 'div'=>false, 'value'=>'', 'style'=>'margin-right:5px;width:200px',
						'placeholder' => 'Your new password again',
						'required' => 'required',
						'pattern' => '.{6,20}'));?>
				</li>
				<div class="" style="float:left">
					<?
						echo $this->Form->end(array(
							'label'=>'Save',
							'class'=>'button',
							'div'=>false
							));
					?>
				</div>
				&nbsp;
				<input type="submit" value="Cancel" onclick="window.location='<?=$this->webroot?>users/view/<?=$user_id?>'">
				</input>
			</ul>
		</div>
	</div>
</div>
